package com.util;

import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class ConfigTest {

    //注解配置类使用其特殊的加载类与方式
    @Test
    public void t1(){
        AnnotationConfigApplicationContext applicationContext=new AnnotationConfigApplicationContext(SpringConfig.class);
        System.out.println(applicationContext.getBean("student"));
    }

    @Test
    public void t2(){
        AnnotationConfigApplicationContext applicationContext=new AnnotationConfigApplicationContext(DataSourceConfiguration.class);
        System.out.println(applicationContext.getBean("u1"));
    }

    @Test
    public void t3(){
        AnnotationConfigApplicationContext applicationContext=new AnnotationConfigApplicationContext(DataSourceConfiguration.class);
        System.out.println(applicationContext.getBean("student"));
    }

}
